package com.vshop.mapper;

import com.vshop.entity.alast.common.ServicePlanOrderRecord;
import com.vshop.entity.comentity.UserOrderPackage;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserOrderPackageMapper {

    List<UserOrderPackage> queryPackageOrderByCode(@Param("partnerCode") String partnerCode,
                                                   @Param("deviceCode") String deviceCode);

    String queryAmount(@Param("packageCode") String packageCode,
                       @Param("partnerCode") String partnerCode,
                       @Param("deviceCode") String deviceCode,
                       @Param("orderId") String orderIds);

    int getOrderListByPackageInfo(@Param("partnerCode") String partnerCode,
                                  @Param("deviceCode") String deviceCode,
                                  @Param("packageCode") String packageCode,
                                  @Param("packageName") String name,
                                  @Param("packageType") String packageType,
                                  @Param("globalOrder") String globalOrder,
                                  @Param("orderPeriod") String orderPeriod,
                                  @Param("payAmount") String payAmount,
                                  @Param("payCurrency") String payCurrency,
                                  @Param("partnerScope") String partnerScope,
                                  @Param("orderNo") String orderNo);

    void insertUserNoCard(UserOrderPackage order);

    void insertUserHaveCard(UserOrderPackage order);

    void updateRenewOrderUserHaveCard(UserOrderPackage reneworder);

    void updateNewOrderUserHaveCard(UserOrderPackage neworder);

    List<UserOrderPackage> queryOrderFee(@Param("orderId") String orderId,
                                         @Param("deviceCode") String deviceCode);

    String queryAmountByCode(@Param("orderId") String orderId,
                             @Param("deviceCode") String deviceCode,
                             @Param("partnerCode") String partnerCode);

    int getOrderListByPackageInfoNoCard(@Param("partnerCode") String partnerCode,
                                        @Param("packageCode") String packageCode,
                                        @Param("packageName") String name,
                                        @Param("packageType") String packageType,
                                        @Param("globalOrder") String globalOrder,
                                        @Param("orderPeriod") String orderPeriod,
                                        @Param("payAmount") String payAmount,
                                        @Param("payCurrency") String payCurrency,
                                        @Param("partnerScope") String partnerScope,
                                        @Param("orderNo") String orderNo);

    List<UserOrderPackage> getRenewPackageList();

    void updateRenewStatus(UserOrderPackage orderPackage);

    List<UserOrderPackage> getNoCardList();

    void updateNoCardOrderId(UserOrderPackage order);

    List<UserOrderPackage> queryOrderByCode(@Param("partnerCode") String partnerCode,
                                            @Param("deviceCode") String deviceCode);

    List<UserOrderPackage> queryOrderById(@Param("partnerCode") String partnerCode,
                                          @Param("payId") String payId);

    List<UserOrderPackage> queryFee(@Param("payId") String payId);

    void updateTimeAndStatus(UserOrderPackage kage);

    int getCountByOrderId(String orderId);

    List<UserOrderPackage> getChannelResultList();

    void updateyIsPartnerNotity(ServicePlanOrderRecord re);

    List<UserOrderPackage> getStatusTimeOrderList();

    List<UserOrderPackage> getListToOpen();

    Integer updateIsOpen(UserOrderPackage userOrder);

    int findCount(@Param("partnerCode") String partnerCode,
                  @Param("packageCode") String packageCode,
                  @Param("requestOrderId") String requestOrderId);

    void dataTransfer();

    void originalDataDelete();

    List<UserOrderPackage> getListToPurchase();

    List<UserOrderPackage> queryRecord(@Param("deviceCode") String deviceCode,
                                       @Param("payId") String payId,
                                       @Param("startDate") String startDate,
                                       @Param("endDate") String endDate);

    String queryPartnerCode(@Param("orderId") String orderId);

    String querySecret(@Param("secret") String secret);
}
